import java.awt.Graphics;



public class BodyPart {

	ydLine limb;
	
	double angularVelocity;
	
	public BodyPart(ydPoint p1, double length){
		limb=new ydLine(p1, length);
	}
	
	public BodyPart(ydPoint p1, ydPoint p2){
		limb=new ydLine(p1, p2);
	}
	
	public void draw(Graphics g){
		limb.drawLine(g);
	}
	
	public static void swap(BodyPart b1, BodyPart b2){
		
		BodyPart tmp=b1;
		b1=b2;
		b2=tmp;
		
		//BodyPart tmp =new BodyPart(b1.limb.p1, b1.limb.p2);
/*		tmp.angularVelocity=b1.angularVelocity;
		
		b1.limb.p1=b2.limb.p1;
		b1.limb.p1=b2.limb.p2;
		b1.limb.recalculate();
		b1.angularVelocity=-b2.angularVelocity;
		
		
		b2.limb.p1=tmp.limb.p1;
		b2.limb.p1=tmp.limb.p2;
		b2.limb.recalculate();
		b2.angularVelocity=-tmp.angularVelocity;*/
	}
	
}
